package org.example.mall.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class ApiController {

    @GetMapping("/api")
    public Map<String, Object> index() {
        Map<String, Object> result = new HashMap<>();
        result.put("status", "success");
        result.put("message", "Mall API Service is running");
        result.put("apis", new String[]{
                "/api/user/register/phone - 手机号注册",
                "/api/user/register - 用户名注册",
                "/api/user/login/phone - 手机号登录",
                "/api/user/login - 用户名登录",
                "/api/user/verification-code - 发送验证码",
                "/api/user/{userId} - 获取/更新用户信息",
                "/api/user/{userId}/password - 修改密码"
        });
        return result;
    }
}